<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Users extends Model
{
    protected $table = 'users';
    protected $guarded = false;


 const GENDER_MALE = 1;
 const GENDER_FEMALE = 2;

 static function getGenders() {
    return [
        self::GENDER_MALE => 'Мужской',
        self::GENDER_FEMALE => 'Женский',
    ];
 }
 //создание геттера genderTitle
 public function getGenderAttribute() {
    return self::getGenders()[$this->gender];
 }
 
}